< previous page page_182 next page >

Page 182
LISTING 8.3.CONTINUED
9f8044bafea36a1f728739c0bb58ef4c.gif
 38: Private Function decreaseBalance(argObject As Object)
 39:    'Make sure incoming object is of type Withdrawal
 40:     If TypeName(argObject) <> Withdrawal Then
 41:         decreaseBalance = False
 42:         Exit Function
 43:     End If
 44:
 45:     'It's a Withdrawal object
 46:    CurrentBalance = CurrentBalance - argObject.Amount
 47:    decreaseBalance = True
 48: End Function
 49:
 50: Private Function increaseBalance(argObject As Object)
 51:     Dim localDeposit As Deposit, booReturns As Boolean
 52:     'Make sure incoming object is of type Deposit
 53:     If TypeName(argObject) <> Deposit Then
 54:         increaseBalance = False
 55:         Exit Function
 56:     End If
 57:
 58:     'It's a Deposit object
 59:     Set localDeposit = argObject
 60:
 61:     'Test for Cash or Check deposits
 62:     booReturns = _ localDeposit.enforceCashDepositLimit(localDeposit)
 63:     If Not booReturns Then
 64:         booReturns = _ localDeposit.enforceFundsAvailability(localDeposit)
 65:     End If
 66:
 67:     CurrentBalance = CurrentBalance + argObject.Amount
 68:     increaseBalance = True
 69: End Function
 70:
 71:
 72: Public Function adjustBalance(argObject As Deposit, argAccountNumber
      As String) As Boolean
 73:     Dim LocalObject As Object, returns As Boolean
 74:
 75:     'If there's more than one account object in memory, a precondition
 76:     'is that this object is the correct object. So check account number
 77:     If argAccountNumber <> AccountNumber Then
 78:          'Raise exceptions here
 79:         Dim sMsg As String
 80:         sMsg = Wrong account number, Please retry.
 81:         RaiseEvent OnWrongAccountNumber(sMsg)
continues

 
< previous page page_182 next page >

If you like this book, buy it!